/*
 * @Author: 邱狮杰
 * @Date: 2021-06-27 13:42:01
 * @LastEditTime: 2021-06-27 13:47:27
 * @FilePath: /catch-null-value/src/core/comment/utils.ts
 * @Description: utils
 */
/**
 * @description 是否是注释
 * @param { string } type
 * @returns { boolean }
 */
export function isComment(type: string): boolean {
  return type === "CommentLine";
}
/**
 * @description 获取注释内容,匹配出去除catch:后的内容
 * @param { string } value
 * @returns { string | boolean}
 */
export function standardValue(value: string): string | boolean {
  const commentResult = value.match(/(?<=goto:).+/g);
  if (!commentResult || !commentResult.length) return false;
  // 结果数组存在，并且数组长度不等于0,去除两遍空格
  return commentResult[0].trim();
}
